package com.hp.webfluxclient;

import com.hp.webfluxclient.api.IUserApi;
import dong.common.JDKProxyCreator;
import dong.common.UserFactoryBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class WebfluxClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(WebfluxClientApplication.class, args);
    }

    @Bean
    public JDKProxyCreator jdkProxyCreator() {
        return new JDKProxyCreator();
    }

    @Bean
    public FactoryBean<IUserApi> userApiFactoryBean() {
        return new UserFactoryBean<IUserApi>(IUserApi.class,jdkProxyCreator());
    }
}
